package nowCoder;

import java.util.Scanner;

/**
 * @Auther: zzx
 * @Date: 2024.02.24/2/3
 */
public class HJ35 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int o = 0;// 竖向步进
        int p = 1;// 竖向初始 = 初始+步进
        for(int i = 0; i<a;i++){
            p = p + o++;
            int n = p; // 横向初始 = 竖向初始
            System.out.print(n+" ");
            int m = o+1; // 横向步进 = 竖向步进+1
            for(int j = 1 ; j < a-i; j++){
                System.out.print(n+m+" ");
                n = n+m++;
            }
            System.out.println();
        }
    }
}
